#include "circle.h"

Circle::Circle(std::vector<double> &data)
{
    x = data[0];
    y = data[1];
    r = data[2];
    angle = data[3];
}

void Circle::setCoord(std::vector<double> &data)
{
    x = data[0];
    y = data[1];
    r = data[2];
    angle = data[3];
}

std::vector<double> Circle::getCoord()
{
    std::vector<double> data;
    data.push_back(x);
    data.push_back(y);
    data.push_back(r);
    data.push_back(angle);
    return data;
}

std::pair<double, double> Circle::centrePoint()
{
    return std::pair<double, double>(x, y);
}

void Circle::shift(double shiftX, double shiftY)
{
    x += shiftX;
    y += shiftY;
}

void Circle::rotation(double rotAngle)
{
    angle = rotAngle;
}

void Circle::extansion(double extCoef)
{
    if(extCoef != 0)
        r *= extCoef;
}

typeFigure Circle::type()
{
    return circle;
}

std::string Circle::dataToString()
{
    return "Circle " + std::to_string(x) + " " + std::to_string(y) + " " + std::to_string(r) + " " + std::to_string(angle);
}
